The present invention relates to a database processing system allowing a user to define a data type and its behavior, and in particular to a technique which is effective for application to a database processing system for efficiently accessing a specific database resource using a user-defined function.
Recently in the field of database management system, the demand for managing multimedia data such as documents and images as a database occurs in the context of the hardware progress and spread of the WWW (World Wide Web). Therefore, the function of arbitrarily defining and managing complicated data which cannot be managed by the conventional relational database management system has become necessary.
In order to satisfy the demand, standardization of SQL3 (ISO, ANSI) is now being advanced in database language SQL (Structured Query Language). UDT (User-Defined Type) is one of principal functions of the SQL3. The UDT is user-defined data type. The object-oriented concept is adopted. Operation for UDT data is also defined by the user as a method (function or procedure). By using the UDT, a complicated data structure can be implemented. Furthermore, behavior of a value itself of UDT data (accompanying function) can be defined as a user-defined function. In the definition of the UDT, a specification of an attribute (group) for representing a value, and a group of operations for representing its behavior are stipulated as a UDT function. It is typical as implementation that these UDT definition information pieces are managed in the database management system as dictionary information in the same way as table definition and so on.
In recent years, a relational database management system adopting the above described object-oriented concept and supporting the function such as user-defined data type is often called object relational database management system.
In the definition of the UDT function, description using the SQL itself is possible. Furthermore, in the definition of this function, it is also possible to describe it by using a general programming language such as the C programming language, compile it, and specify a module registered in the system. Relations between these modules and the UDT functions are described in a type definition statement (CREATE TYPE statement) for defining a UDT. In other words, the module is an internal implementation form of the UDT function. The implementation of the UDT function and the module is described in Don Chamberlin: xe2x80x9cUsing the new DB2: IBM""s Object-Relational Database Systemxe2x80x9d, pp. 285, 1966, and so on.
By using the UDT, it becomes possible to implement the function corresponding to multimedia data as a function of the database management system. This means that the processing which has been conducted in the application program until now can be implemented on the database system side at high speed and with a low development cost.
As the function corresponding to multimedia data referred to herein, a complicated and enhanced retrieval function which is not present in the conventional relational database management system can be mentioned. A retrieval system specific to data such as image, voice, document, and map information typically has an index for satisfying each retrieval function. In the object-relational database management system as well, it becomes necessary to have a certain index or information taking the place thereof, and provide a retrieval function specific to the UDT by accessing those xe2x80x9cDB resourcesxe2x80x9d through the UDT function. Because in the UDT function of only processing for UDT data which is column data of a table, such a function as to sufficiently satisfy users needs for multimedia data cannot be implemented. In other words, for acceding to users needs for multimedia data, a DB resource managed under the UDT becomes necessary besides the table data. In the database management system, such a mechanism as to manage such a DB resource becomes necessary.
On the other hand, a different charm of the object-relational database management system is in that existing data existing on the relational database management system can be employed efficiently as they are, i.e., in table form retrieval which is the merit of the relational model. In other words, synthetic retrieval related to column data in the same of different table is possible.
In the case where a UDT function having a DB resource as described above and implementing a function by accessing the DB resource has been introduced, a place where a UDT function implementing module is executed (invoked) is limited to the place (server) where the DB resource is present. Therefore, the optimizer of the object-relational database management system must conduct planning so as to necessarily invoke the UDT implementation module in a table storing BES (Back End Server) where there might be DB resource access. This results in a problem that the execution performance such as a query accompanied by matching processing of a plurality of rows is not sufficiently obtained, and effects of the relational model cannot be sufficiently given.
An object of the present invention is to provide a technique capable of solving the above described problem and efficiently conducting database processing of accessing a specific DB resource.
In accordance with the present invention, a database processing system for starting a module to implement a function related to a data type of a query subject and conducting database processing is so adapted that when a module for implementing a function in the query given by the user accesses a specific DB resource, an execution procedure is determined so as to execute the module in a database processing apparatus which is storing and managing the database resource.
In the database processing system of the present invention, when registering module definition information of a module for implementing a function related to a data type defined in a database, DB resource access information indicating whether the module should access a DB resource specific to its data type is registered.
When receiving a query given by a user and conducting corresponding database processing, the query is analyzed and DB resource access information of the module for implementing a function included in the query is referred to. If the information indicates that access to the specific DB resource should be conducted, then an execution procedure is determined so as to execute the module in a database processing apparatus which is storing and managing the database resource.
If the information indicates that access to the specific DB resource should not be conducted, then an execution procedure is determined so as to execute the module in a database processing apparatus having a lowest module execution frequency or a database processing apparatus having no relation to the database processing apparatus which is storing and managing the DB resource.
In the database processing system of the present invention, a module for accessing a specific DB resource is executed in a database processing apparatus which is storing and managing the DB resource whereas modules other than the module are executed in other database processing apparatuses, as heretofore described. Therefore, database processing of accessing the specific DB resource can be conducted efficiently.